package com.mxpio.erp.common.purchase.entity;

import com.mxpio.erp.common.jpa.model.Order;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PURC_BUY_REQUEST")
@ApiModel(value="请购单")
public class BuyRequest extends Order {
	private static final long serialVersionUID = 1L;

	@Column(name = "BIZ_TYPE_")
	@ApiModelProperty(value = "单据类型")
    @Dict(dicCode = "ERP_PURC_BUY_REQUEST_TYPE")
	private String bizType;

	@ApiModelProperty(value = "供应商编号")
	@Column(name = "SUPPLIER_CODE_")
	private String supplierCode;

	@ApiModelProperty(value = "供应商名称")
	@Column(name = "SUPPLIER_NAME_")
	private String supplierName;

	@Column(name = "ITEM_CODE_")
	@ApiModelProperty(value = "物料编码")
	private String itemCode;

	@ApiModelProperty(value = "物料名称")
	@Column(name = "ITEM_NAME_")
	private String itemName;

	@Column(name = "ITEM_SPEC_")
	@ApiModelProperty(value = "规格型号")
	private String itemSpec ;

	@Column(name = "MATERIAL_STANDARD_")
	@ApiModelProperty(value = "材料标准")
	private String materialStandard ;

	@Column(name = "MATERIAL_MARK_")
	@ApiModelProperty(value = "材料牌号")
	private String materialMark ;

	@Column(name = "UNIT_CODE_")
	@ApiModelProperty(value = "单位编号")
	private String unitCode;

	@Column(name = "PRICE_")
	@ApiModelProperty(value = "单价")
	private BigDecimal price;

	@Column(name = "QUANTITY_")
	@ApiModelProperty(value = "数量")
	private BigDecimal quantity;

	@ApiModelProperty(value = "建议下单日期")
	@Column(name = "SUGGEST_ORDER_DATE_")
	private Date suggestOrderDate;

	@ApiModelProperty(value = "建议到货日期")
	@Column(name = "SUGGEST_ARRIVE_DATE_")
	private Date suggestArriveDate;

	@Column(name = "SHIPPING_ADDRESS_")
	@ApiModelProperty(value = "发货地址")
	private String shippingAddress;

	@Column(name = "SALESMAN_")
	@ApiModelProperty(value = "业务员")
	private String salesman ;

	@ApiModelProperty(value = "备注")
	@Column(name = "MEMO_")
	private String memo;

	@Override
	public String initTypeCode() {
		return "BR1";
	}
}
